package com.radiusmess;

import javax.servlet.ServletContext;

import org.apache.struts2.ServletActionContext;

public class Ident {
	public static int getIdemt(){
		String key ="shengdaRadiusID";
		ServletContext appli = ServletActionContext.getRequest().getSession().getServletContext();
		Integer radiusId=(Integer) appli.getAttribute(key);
		if(radiusId!=null){
			int id = radiusId;
			if(id<254){
				appli.setAttribute(key, id+1);
			}else{
				appli.setAttribute(key, 1);
			}
		}else{
			appli.setAttribute(key, 1);
			radiusId=1;
		}
		return radiusId;
	}
}
